package com.app.backend.base.service;

import com.app.backend.base.entity.User;
import com.app.backend.base.vo.UserVo;
import com.app.backend.common.base.BaseService;
import org.springframework.cache.annotation.CacheConfig;
import org.springframework.cache.annotation.Cacheable;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.Pageable;

/**
 * @program: UserService
 * @description:
 * @author: Zhun.Xiao
 * @create: 2020-02-08 18:02
 **/
@CacheConfig(cacheNames = "user")
public interface UserService extends BaseService<User, String> {

    @Cacheable(keyGenerator = "KeyGenerator")
    User findByUsername(String username);

    /**
     * 根据输入用户信息（username,mobile） 模糊查询，并跨表查询 role
     *
     * @param userVo
     * @param initPage
     * @return
     */
    Page<User> findAllByConditionPage(UserVo userVo, Pageable initPage);
}